<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Radiological Equipment Database</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Eugene Mah">
<link rev="made" href="mailto:eugenem@ix.netcom.com">
<link rev="home" href="http://home.netcom.com/~eugenem/">
<meta name="description" content="">
<meta name="Keywords" content="">
<meta name="Reply-to" content="eugenem@ix.netcom.com">
<META http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~0001))'>
<?PHP
require('functions.inc');
require('dbc.inc');

?>
</head>

<body>
<h1>Radiological Equipment Database</h1>
<h2>Survey Report Sent Date</h2>
<?php
if (isset($_POST['SurveyID']) && isset($_POST['RepSentDate']) && isset($_POST['Submit'])) {
  $query = "UPDATE TestDates SET ReportSentDate=\"" . $_POST['RepSentDate'] . "\" WHERE
            SurveyID = " . $_POST['SurveyID'];
  $result = mysql_query($query)
    or die("<p>Unable to execute query: $query<br />" . mysql_error() . "</p>\n");
  echo "<p>Survey " . $_POST['SurveyID'] . " updated\n</p>";;
}
?>
<form action="SurveyRepSent.php" method="post" name="Report Sent">
Enter survey ID:
<?PHP
$survID = mysql_query("SELECT TestDates.SurveyID, CONCAT_WS(\" \",Machines.Description, TestDates.TestDate) 
                       FROM TestDates
											 LEFT JOIN Survey2Machine USING (SurveyID)
											 LEFT JOIN Machines ON Survey2Machine.MachineID=Machines.MachineID
											 WHERE (ReportSentDate IS NULL OR ReportSentDate = \"0000-00-00\")
											 AND Machines.Status=\"Active\" ORDER BY SurveyID");
echo listbox_field($survID,"SurveyID","");
?>
<p>Enter date report was sent out: <input name="RepSentDate" type="text" size="10" /> (YYYY-MM-DD)</p>
<input name="Submit" type="submit" value="Submit" /> / <input name="Reset" type="reset" /> / <a href="index.html" target="_top">Main</a>
</form>
</body>
</html>
